﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
using NUnit.Framework;
using SportsStore.Repository.Repositories;

namespace SportsStore.IntegrationTests.Repositories
{
  public class CategoryRepositoryTest
  {
    [SetUp]
    public void Setup()
    {
      _categoryRepository = new CategoryRepository(ConfigurationManager.ConnectionStrings["SportsStore"].ConnectionString);
    }

    private CategoryRepository _categoryRepository;

    [Test]
    public void GivenThereAreProductsForMultipleCategories_WhenIGetTheProducts_IGetTheDistinctCategories()
    {
      var retriedCategories = _categoryRepository.GetCategories();

      Assert.That(retriedCategories.Count(), Is.EqualTo(3));
    }
  }
}
